package com.hhp.hhptt.controller.controllerstudent;

import com.hhp.hhptt.common.Constants;
import com.hhp.hhptt.common.Result;
import com.hhp.hhptt.controller.dto.UserDTO;
import com.hhp.hhptt.entity.TMap;
import com.hhp.hhptt.service.TMapService;
import com.mysql.cj.util.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Demo
 * @Author LiTianYu
 * @Date 2024/6/14 14:52
 */
@RestController
@RequestMapping("/api/map")
public class MapController {
    @Autowired
    private TMapService service;

    @GetMapping("/maps")
    public Result findAll() {
        try {
            List<TMap> tMapList = service.findAll();
            return Result.success("成功",tMapList);
        }catch (Exception e){
            return Result.error("0",e.toString());
        }
    }
}
